<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@include file="../common.jsp"%>


<script type="text/javascript">
function deleteTask(){
	var c = document.getElementsByName("check");
	var n=0;
	for(var i=0;i<c.length;i++){
		if(c[i].checked==true){
			n++;
		}
	}
	if(n==0){
		alert("请选中后再进行删除操作！");
	}else{
		if(confirm('确定删除?')){
		   document.form1.submit();
			return true;
		}else {
		 return false;
		}
	}
}
</script>
<form name="form1" action="../emp/deletAction.action" method="post">
<div id="content_right">

	<p id="whereami">
	</p>
	<TABLE class=table cellSpacing=1>
		<TBODY>
			<TR class=table_header>
				
				<TD vAlign=center align=left>
					ID
				</TD>
				<TD vAlign=center align=left>
					姓名
				</TD>
				<TD vAlign=center align=left>
					所属部门
				</TD>
				<TD vAlign=center align=left>
				    人员类型
				</TD>
				<TD vAlign=center align=left>
				</TD>
				<TD vAlign=center align=left>
				    删除
				</TD>
				<TD vAlign=center align=left>
				    修改
				</TD>
			</TR>
			<s:iterator value="liem" var="Employee">
				<TR class=row2 onmouseover="this.className='row1'"
					onmouseout="this.className='row2'">
					<TD vAlign=center align=left>
						${Employee.empId }
					</TD>
					<TD vAlign=center align=left>
						${Employee.empName }
					</TD>
					<TD vAlign=center align=left>
						${Employee.department.deptId }
					</TD>
					<TD vAlign=center align=left>
					<c:choose>
						<c:when test="${Employee.empStyle==0}"></c:when>
						<c:when test="${Employee.empStyle==1}">普通员工</c:when>
						<c:when test="${Employee.empStyle==2}">普通管理员</c:when>
						<c:when test="${Employee.empStyle==3}">系统管理员</c:when>
					</c:choose>
					</TD>
					<TD vAlign=center align=left>
						<a href="empInfor.action?empId=${Employee.empId }">详细信息</a>
					</TD>
					<TD vAlign=center align=left>
					<input type="checkbox" name="check" value="${Employee.empId }"/>
				    </td>
				    <TD vAlign=center align=left>
						<a href="../emp/updateAction.action?empId=${Employee.empId }">修改</a>
					</TD>
				</TR>
			</s:iterator>
		</TBODY>
		
		
	</TABLE>
	
	<p align="right">
	<input type="button" class="button" value="删除&gt&gt"
		onclick="deleteTask()" />
</p>
	<div   >
	<p class="paging">
	<s:if test="%{pageBean.currentPage == 1}">
		&lt;&lt; 首页 &lt; 上一页
	</s:if>
	<s:else>
		<a href="empDaoList.action?page=1"> &lt;&lt;首页</a>
		<a href="empDaoList.action?page=${pageBean.currentPage-1}">&lt; 上一页 </a>
	</s:else>

	<strong>第${pageBean.currentPage}页/共${pageBean.totalPage}页</strong>
	
	<s:if test="%{pageBean.currentPage == pageBean.totalPage}">
		下一页 &gt;
		末页 &gt;&gt;
	</s:if>
	<s:else>
		<a href="empDaoList.action?page=${pageBean.currentPage+1}"> 下一页 &gt;</a>
		<a href="empDaoList.action?page=${pageBean.totalPage}">末页 &gt;&gt;</a>
	</s:else>
</p>
 </div>
	<p>
		&nbsp;
	</p>
	<p>
	</p>

</div>
</form>